home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / METRIC.HDR < prev    next >
Text File  |  1994-04-25  |  3KB  |  91 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _MetricConvert( nVal, cTypeConvert ) --> nVal
  8.  
  9. PARAMETERS:
  10.  
  11. nVal         : Metric or American Measurement for conversion.
  12. cTypeConvert : Type of conversion to perform on nVal
  13.  
  14. SHORT:
  15.  
  16. Perform various metric/American conversions.
  17.  
  18. DESCRIPTION:
  19.  
  20. _MetricConvert() converts values between Metric and American both ways.
  21. The following table describes the KMETRIC.CH header file which should be
  22. used to specify the value for cTypeConvert:
  23.  
  24.     C_TO_F     Centigrade to Fahrenheit
  25.     F_TO_C     Fahrenheit to Centigrade
  26.     F_TO_M     Feet into Meters
  27.     M_TO_F     Meters to Feet
  28.     I_TO_C     Inches to Centimeters
  29.     C_TO_I     Centimeters to Inches
  30.     K_TO_P     Kilograms to Pounds
  31.     P_TO_K     Pounds to Kilograms
  32.     G_TO_L     Gallons to Liters
  33.     L_TO_G     Liters to Gallons
  34.     CF_TO_G    Cubic Feet Luquid to Gallons
  35.     G_TO_CF    Gallons to Cubic Feet Liquid
  36.     CM_TO_G    Cubic Meters Liquid to Gallons
  37.     G_TO_CM    Gallons to Cubic Meters Liquid
  38.     K_TO_M     Kilometers to Miles
  39.     M_TO_K     Miles to Kilometers
  40.     M_TO_KNT   Miles to Knots
  41.     KNT_TO_M   Knots to Miles
  42.     MPG_TO_KPL Miles per Gallons to Kilometers per Liter
  43.     KPL_TO_MPG Kilometers per Liter to Miles per Gallon
  44.     CC_TO_CI   Cubic Centimeters to Cubic Inches
  45.     CI_TO_CC   Cubic Inches to Cubic Centimeters
  46.     KSC_TO_PSI Kilograms Per Square Centimeter to Pounds Per Square Inch
  47.     PSI_TO_KSC Pounds Per Square Inch to Kilograms Per Square Centimeter
  48.     SF_TO_SM   Square Feet to Square Meters
  49.     SM_TO_SF   Square Meters to Square Feet
  50.     SF_TO_A    Square Feet to Acres
  51.     A_TO_SF    Acres to Square Feet
  52.     SM_TO_A    Square Miles to Acres
  53.     A_TO_SM    Acres to Square Miles
  54.     A_TO_HA    Acres to Hectacres
  55.     HA_TO_A    Hectacres to Acres
  56.     LB_TO_ST   Pounds to Stones
  57.     ST_TO_LB   Stones to Pounds
  58.  
  59. NOTE:
  60.  
  61. Be aware of your DECIMALS setting when using these functions!
  62.  
  63. CREDIT: Thanks to Mark Lussier and Timothy W. Cook of AppVision Software for
  64. preventing me from having to reinvent the wheel.  The formulas for 32 of
  65. these conversions are extracted from their thirty-two separate functions
  66. contained in their public domain _Metric! Library_.
  67.  
  68. EXAMPLE:
  69.  
  70. [Just SOME examples, not all...]
  71.  
  72. // Convert 100 degrees Centigrade to Farenheit
  73. t = _MetricConvert( 100, C_TO_F )
  74.  
  75. // Convert 100 Miles to Kilometers
  76. t = _MetricConvert( 100, M_TO_K )
  77.  
  78. // Convert 100 Feet to Meters
  79. t = _MetricConvert( 100, F_TO_M )
  80.  
  81. // Convert 100 Centimeters to inches
  82. t = _MetricConvert( 100, C_TO_I )
  83.  
  84. // Convert 175 Pounds to Stones
  85. t = _MetricConvert( 175, LB_TO_ST )
  86.  
  87. // Convert 175 Stones to Pounds
  88. t = _MetricConvert( 175, ST_TO_LB )
  89.  
  90. ******************************************************************************/
  91.